package com.zykj.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author zhoulj(周利军) [1217102780@qq.com]
 * @Title: ZaocanMenum
 * @Project: ${MODEL_NAME}
 * @Module ID:   <(模块)类编号，可以引用系统设计中的类编号>
 * @Comments: <对此类的描述，可以引用系统设计中的描述>
 * @JDK version used:      <JDK1.8> 13
 * @since 2019/1/7-21:13
 */
public class ZaocanMenum implements Menu {
    List<MenuItem> menuItems;
    public ZaocanMenum() {
        menuItems = new ArrayList<MenuItem>();
        addItem("豆浆", "豆浆..", true, 2.5);
        addItem("油条", "油条..", true, 1.5);
        addItem("包子", "包子..", false, 1.5);
        addItem("馒头", "馒头..", true, 0.5);
    }
    public void addItem(String name, String descrption, boolean vege, double price) {
        MenuItem menuItem = new MenuItem(name, descrption, vege, price);
        menuItems.add(menuItem);
    }

    @Override
    public Iterator createIterator() {
        return menuItems.iterator();
    }
}
